package demoworld.controllers;

import demoworld.business.interfaces.IBookBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import xxx.entities.result.BookResult;

/**
 * Created by francis on 2017/6/18.
 */

@Controller
@ResponseBody
@RequestMapping("/book")
public class BookController {
    //http://localhost:8080/book/?id=1 访问
    @Autowired
    private IBookBiz bookBiz;
    @RequestMapping("/")
    public BookResult getBookByBookId(@RequestParam(value = "id", required = false, defaultValue = "0") long id) {
        BookResult tmpResult =bookBiz.getBookByBookId(id);

        return tmpResult;
    }
}